package com.yigerende.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/*
 * ���ݿ�����
 * */
public class DBConnectionUtils {
	private static final String LIANJIE="com.mysql.jdbc.Driver";
	private static final String URL="jdbc:mysql://localhost:3306/newsdb";
	private static final String NAME="root";
	private static final String PWD="beyourself";
	
	static {
		try {
			Class.forName(LIANJIE);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection() {
		try {
			return DriverManager.getConnection(URL,NAME,PWD);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
